package com.bloody.android.Characters;

import android.os.Bundle;
import android.util.Log;

import com.bloody.android.BloodyCrusadeGame;
import com.bloody.android.Map.Map;

public class NarutoAbility extends SpecialAbility{
	
	private int attack;

	public NarutoAbility(Map map, int attack) {
		super("Rasengan", map);
		this.attack=attack;
		int [] attackRange;
		attackRange = new int[2];
		for (int i= 0; i<attackRange.length; i++)
			attackRange[i]=i+1;
		super.setRange(attackRange);		
	}
	
	public Bundle effect(BloodyCrusadeGame bcg, int level){
		int otherPosX = bcg.getPositionX();
		int otherPosY = bcg.getPositionY();
		Character attacked = super.getMap().getCharacter(otherPosX, otherPosY);
		
		int dommage=0;
		if(level==1)
			dommage=attack/2;
		else if(level==2)
			dommage=attack+30;
		
		attacked.hurt(dommage);

		Bundle bundle = new Bundle();
		bundle.putSerializable("giver", super.getCharacter());
		bundle.putSerializable("receiver", attacked);
		bundle.putInt("dommage", dommage);
		bundle.putString("name", super.getName());
		return bundle;
	}

}
